wij=0.2*(rand(3,2)-0.5)
wjk=0.2*(rand(3,1)-0.5)
temp=[];

for i=1:100000
    [wij,wjk,dw]=once_training([0 0],0,0.1,wij,wjk);
    [wij,wjk,dw]=once_training([0 1],1,0.1,wij,wjk);
    [wij,wjk,dw]=once_training([1 0],1,0.1,wij,wjk);
    [wij,wjk,dw]=once_training([1 1],0,0.1,wij,wjk);
    disp(dw);
    temp=[temp dw];
end

disp('testing..:');
disp('the output of 0 0 is');
disp(output([0 0],wij,wjk));
disp('the output of 0 1 is');
disp(output([0 1],wij,wjk));
disp('the output of 1 0 is');
disp(output([1 0],wij,wjk));
disp('the output of 1 1 is');
disp(output([1 1],wij,wjk));
wij
wjk
plot(temp);
disp('hidden analyze');
disp('the output of hiddenlayer of 0 0 is:');
disp(hidden_ana([0 0],wij));
disp('the output of hiddenlayer of 0 1 is:');
disp(hidden_ana([0 1],wij));
disp('the output of hiddenlayer of 1 0 is:');
disp(hidden_ana([1 0],wij));
disp('the output of hiddenlayer of 1 1 is:');
disp(hidden_ana([1 1],wij));

